<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <include file="Pub:head"/>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/Style.css" />
    <script type="text/javascript">
        function edityewu(id,cid){
            top.Dialog.open({URL:"__APP__/kefu/addyewu/id/"+id+"/type/1/cid/"+cid,Title:"编辑400电话",Width:600,Height:480});
        }

        function giveupyewu(id,cid,type){
            if(confirm("确定要放弃该客户签单吗？"))
            {
                var url= "__URL__/yewugiveup/id/"+id+"/type/"+type+"/cid/"+cid;
                window.location.assign(url);
            }
        }

        $(document).ready(function(){
            $(".data_list tr td.huifangtd").dblclick(function() {
                var id=$(this).attr('id');
                top.Dialog.open({URL:"__APP__/kefu/edithuifang/id/"+id+"/type/1",Title:"客户回访记录",Width:850,Height:500});
            });
        })

        $(document).ready(function(){
            $(".data_list tr td.xufeitd").dblclick(function() {
                var id=$(this).attr('id');
                top.Dialog.open({URL:"__APP__/kefu/editxufei/id/"+id+"/type/1",Title:"客户续费记录",Width:850,Height:500});
            });
        })

        function search()
        {
            query_userName= $("#query_userName").val()==""?"0":$("#query_userName").val();
            query_sdate=$("#query_sdate").val()==""?"0":$("#query_sdate").val();
            query_edate=$("#query_edate").val()==""?"0":$("#query_edate").val();
            var url="__URL__/tel400list/query_type/1/query_userName/"+query_userName+"/query_sdate/"+query_sdate+"/query_edate/"+query_edate+"/query_isgiveup/"+$("#query_isgiveup").val();
            window.location.assign(url);
        }
    </script>
    <script type="text/javascript" src="__PUBLIC__/js/showdate.js"></script>
</head>
<body>
<div class="box1">
<fieldset style="border-color:#999999;">
    <legend>400电话客户信息管理</legend>
    <div class="box2" panelTitle="功能面板" id="searchPanel">
        <table>
            <tr>
               <!-- <td>
                    <button type="button" onclick='top.Dialog.open({URL:"__APP__/kefu/add400tel/",Title:"添加400电话信息 ",Width:600,Height:380});'><span class="icon_add">添加</span></button>
                </td>
                <td style=" width:20px;"></td>-->
                <td>客户名称：</td>
                <td><input id="query_userName" name="query_userName" value="{$query_userName}" type="text"/></td>
                <td>
                    签单日期：
                </td>
                <td>
                    <input type="text" id="query_sdate" name="query_sdate"  onclick="return Calendar('query_sdate');" class="formTitle"
                           value="{$query_sdate}"/>
                    -
                    <input type="text" id="query_edate" name="query_edate"  onclick="return Calendar('query_edate');" class="formTitle"
                           value="{$query_edate}"/>

                </td>

                <td>订单状态：</td>
                <td>
                    <select name="query_isgiveup" id="query_isgiveup" keepDefaultStyle="true">
                        <option value="0" <?php if($query_isgiveup=='0') echo "selected";?>>正常</option>
                        <option value="1" <?php if($query_isgiveup=='1') echo "selected";?>>已放弃</option>
                    </select>
                </td>

                <td>
                    <button type="button" onclick="search()"><span class="icon_find">搜索</span></button>
                </td>


            </tr>
        </table>
    </div>

    <table class="tableStyle data_list">
        <tr id="{$vo['id']}">
            <td>负责人</td>
            <td>公司名称</td>
            <td>联系电话</td>
            <td>签单号码</td>
            <td>回访记录</td>
            <td>续费记录</td>
            <td>项目价格</td>
            <td>签单日期</td>
            <td>签单人</td>
            <td>备注</td>
            <?php
             if($query_isgiveup=='0')
             { ?>
            <td>操作</td>
            <?php
             }?>
        </tr>
        <volist name="tel400List" id="vo">
            <tr <?php $zero1=strtotime($vo['signdate']);
                   $zero2=strtotime(date("y-m-d h:i:s"));
                   $days=ceil(($zero2-$zero1)/86400);
                   if($days>360)
            {?>
            style="background-color:#ffff00;"
            <?php }?>
            >
                <td>{$vo['cname']}</td>
                <td><span <?php if(mb_strlen($vo['company'],'utf8')>15){ ?> title="{$vo['company']}<?php } ?>">
                    {$vo['company']|msubstr=0,15,'utf-8',false}</span></td>
                <td>{$vo['tel']}</td>
                <td>{$vo['signnumber']}</td>
                <td class="huifangtd" id="{$vo['id']}" style="cursor:pointer;">
                    <font color="red">
                    <?php
                     $rcontent=$huifangdata[$vo['id']]['content'];
                 ?>
                    {$rcontent|msubstr=0,10,'utf-8',true} </font>
                </td>
                <td class="xufeitd" id="{$vo['id']}" style="cursor:pointer;">
                    <font color="red">
                        <?php
                     $rxumoney=$xufeidata[$vo['id']]['xumoney'];
                     ?>
                        {$rxumoney|msubstr=0,10,'utf-8',true} </font>
                </td>
                <td>{$vo['projectprice']}</td>
                <td> <?php if($vo['signdate']!='0000-00-00 00:00:00') echo date('Y-m-d',strtotime($vo['signdate'])); ?></td>
                <td>{$vo['signuser']}</td>
                <td><span <?php if(mb_strlen($vo['remark'],'utf8')>10){ ?> title="{$vo['remark']}<?php } ?>">
                    {$vo['remark']|msubstr=0,10,'utf-8',true}</span></td>
                <?php
                 if($query_isgiveup=='0')
                 { ?>
                <td>
                    <a  href="javascript:void(0);"  onclick="edityewu({$vo['id']},{$vo['cid']});"> 编辑 </a> /
                    <a  href="javascript:void(0);"  onclick="giveupyewu({$vo['id']},{$vo['cid']},1);"  href="__URL__/yewugiveup/id/{$vo['id']}/type/1/cid/{$vo['cid']}">放弃</a>
                </td>
                <?php
                  }?>
            </tr>
        </volist>
    </table>

</fieldset>
    <div id="TourExPage" class="page">{$pageshow}</div>

</div>
</body>
</html>